package com.jian.mygame;

import java.util.ArrayList;

import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.ContactListener;
import org.jbox2d.dynamics.contacts.ContactPoint;
import org.jbox2d.dynamics.contacts.ContactResult;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class MyContactListener implements ContactListener{
	Canvas mCanvas;
	ArrayList<ContactPoint> mContactPoint = new ArrayList<ContactPoint>();
	
	@Override
	public void add(ContactPoint cp) {
		System.out.println("Contact detected");
		mContactPoint.add(cp);
		//if( mCanvas != null ){
		//	DrawContact( mCanvas, cp.position.x*MyWorld.RATE, cp.position.y*MyWorld.RATE);
		//}
	}


	@Override
	public void persist(ContactPoint cp) {
		System.out.println("Contact persisting");
	}


	@Override
	public void remove(ContactPoint cp) {
		System.out.println("Contact removed");
	}


	@Override
	public void result(ContactResult cr) {
	}
	
	public void setCanvas( Canvas canvas ) {
		mCanvas = canvas;
	}
	

}

